// @APIVersion 1.0.0
// @Title **职业技术学院
// @Description 考勤系统的接口文档
package routers

import (
	"classmates/controllers"

	beego "github.com/beego/beego/v2/server/web"
)

func init() {
	ns := beego.NewNamespace("/api",
		beego.NSNamespace("/classmates",
			beego.NSInclude(
				&controllers.ClassmatesController{},
			),
		),
		beego.NSNamespace("/records",
			beego.NSInclude(
				&controllers.RecordsController{},
			),
		),
	)
	beego.AddNamespace(ns)

	// beego.Error("是否允许跨域提交:", allowAllOrigins)
	beego.InsertFilter(`/api/*`, beego.BeforeRouter, controllers.FilterUser)
	beego.Router("/", &controllers.ClassmatesController{}, "*:Login")
	beego.Router("/home", &controllers.ClassmatesController{}, "*:Home")
	beego.Router("/info", &controllers.ClassmatesController{}, "*:Info")
	beego.Router("/records", &controllers.RecordsController{}, "*:Records")
	beego.Router("/fill", &controllers.RecordsController{}, "*:Fill")
	beego.Router("/choujiang", &controllers.RecordsController{}, "*:Choujiang")
	beego.Router("/ws/loadPersons", &controllers.RecordsController{}, "*:LoadPersons")
}
